package com.example.demo.entity.responseJson;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;


/**
 * @ClassName: ResponseResult
 * @Description: ResponseResult
 * @Author: zzz
 * @Date: 2020-04-04 21:52
 */
@ApiModel(value = "集合和总条数模板")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ListResult<T> {
    @ApiModelProperty(value = "总条数")
    private Integer count;
    @ApiModelProperty(value = "状态信息")
    private T data;
    @ApiModelProperty(value = "总和")
    private BigDecimal sum;

    public ListResult() {
    }

    public ListResult(Integer count,
                      T data) {
        this.count = count;
        this.data = data;
    }

    public ListResult(Integer count,
                      T data,
                      BigDecimal sum) {
        this.count = count;
        this.data = data;
        this.sum = sum;

    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ListResult{" +
                "count=" + count +
                ", data=" + data +
                '}';
    }

    public BigDecimal getSum() {
        return sum;
    }

    public void setSum(BigDecimal sum) {
        this.sum = sum;
    }
}
